package cn.net.withub.dataCollector.common.utils;

/*import org.safehaus.uuid.UUIDGenerator;
import org.springframework.stereotype.Component;*/

import org.hibernate.id.UUIDGenerator;
import org.springframework.stereotype.Component;

@Component(value="createNewKey")
public class CreateNewKey {
	public static String defateFyjbm="0";
	public static String getNewKey(){
		return getNewKey(null);
	}
	 
	public static String getNewKey(String fyjbm) {
		fyjbm = fyjbm == null || fyjbm.trim().equals("") ? "0" : fyjbm;
		//return fyjbm+ UUIDGenerator.getInstance().generateRandomBasedUUID().toString();
		return fyjbm;
	}

	public synchronized String createId(){
		return createId(null);
	}
	
	public synchronized String createId(String fyjbm) {
		fyjbm = fyjbm == null || fyjbm.trim().equals("") ? "0" : fyjbm;
		//return fyjbm+ UUIDGenerator.getInstance().generateRandomBasedUUID().toString();
		return fyjbm;
	}
}
